package com.lightheart.sphr.xiaobinggan.design

import android.content.Context
import android.content.Intent
import android.view.LayoutInflater
import android.widget.TextView
import com.blankj.utilcode.util.ToastUtils
import com.lightheart.sphr.xiaobinggan.R
import com.lightheart.sphr.xiaobinggan.base.BaseActivity
import com.lightheart.sphr.xiaobinggan.module.home.presenter.HomePresenter
import kotlinx.android.synthetic.main.activity_auto_next.*
import kotlinx.android.synthetic.main.common_toolbar.*

class AutoNextActivity : BaseActivity<HomePresenter>() {

    private var list = ArrayList<String>()

    companion object {
        fun show(context: Context) {
            val intent = Intent(context, AutoNextActivity.javaClass)
            context.startActivity(intent)
        }
    }

    override fun getLayoutId() = R.layout.activity_auto_next

    override fun initInjector() {
    }

    override fun initView() {
        initToolbar(common_toolbar, common_toolbar_title_tv, bt_sub, R.string.clipping, false, 0)
        list.add("天然呆")
        list.add("可爱")
        list.add("逗比")
        list.add("减肥无用行者")
        list.add("孤独的患者")
        for (i in list.indices) {
            val view = LayoutInflater.from(this@AutoNextActivity).inflate(R.layout.item_search_get, null)
            val tv = view.findViewById<TextView>(R.id.tv_title)
            tv.text = list[i]
            tv.setOnClickListener {
                ToastUtils.showLong("点击啦呀")
            }
            autoNext.addView(view)
        }
    }
}